package com.edu.web.controller;

import com.edu.model.User;
import com.edu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Auther: thinkpad
 * @Date: 2019/1/29 00:04
 * @Description:
 */
@Controller
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;
    @RequestMapping("login")
    public String login(){
        System.out.println("....");
        return "Default";
    }

    @RequestMapping("find")
    public String find(Integer id){
        User user = userService.findById(id);
        System.out.println(user);
        return null;
    }

    @RequestMapping("manage")
    public String manage(){

        return "User/UserManage";
    }

    @RequestMapping("info")
    public String info(){

        return "User/UserInfo";
    }

    @RequestMapping("edit")
    public String edit(){

        return "User/UserEdit";
    }
}
